<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//第三方登录
Route::group(['namespace' => 'Home','middleware'=> ['configs']], function () {
    Route::get('/oauth/qq', 'AuthController@qqLogin')->name('home.qq.login');
    Route::any('/oauth/qq/callback', 'AuthController@qqReturn')->name('home.qq.return');
    Route::get('/oauth/weibo', 'AuthController@weiBoLogin')->name('home.weibo.login');
    Route::any('/oauth/weibo/callback', 'AuthController@weiBoReturn')->name('home.weibo.return');
});

Route::group(['namespace' => 'Home','middleware'=> ['configs','wap']], function () {
    Route::any('/login', 'AuthController@login')->name('home.auth.login'); //登录
    Route::any('/register', 'AuthController@register')->name('home.auth.register'); //注册
    Route::post('/sms', 'AuthController@sms')->name('home.auth.sms'); //发送短信
    Route::get('/logout', 'AuthController@logout')->name('home.auth.logout'); //登录
    Route::any('/find', 'AuthController@find')->name('home.auth.find'); //找回密码

    Route::get('/', 'IndexController@index')->name('home.index.index'); //首页
    Route::get('/search', 'IndexController@search')->name('home.index.search'); //搜索
    Route::get('/about', 'IndexController@about')->name('home.index.about'); //单页
    Route::get('/refresh', 'IndexController@refresh')->name('home.index.refresh'); //换一换专栏作者
    Route::group(['prefix' => 'new'], function () {
        Route::get('/', 'NewController@index')->name('home.new.index'); //新闻
        Route::get('/info', 'NewController@info')->name('home.new.info'); //新闻详情
        Route::post('/praise','NewController@praise')->name('home.new.praise');//点赞
    });
    Route::group(['prefix' => 'live'], function () {
        Route::get('/', 'LiveController@index')->name('home.live.index'); //快讯
    });
    Route::group(['prefix' => 'college'], function () {
        Route::get('/', 'CollegeController@index')->name('home.college.index'); //学院
        Route::get('/info', 'CollegeController@info')->name('home.college.info'); //学院详情
        Route::get('/download', 'CollegeController@download')->name('home.college.download'); //下载
    });
    Route::group(['prefix' => 'column'], function () {
        Route::get('/', 'ColumnController@index')->name('home.column.index'); //专栏
        Route::get('/info', 'ColumnController@info')->name('home.column.info'); //专栏详情
    });
    Route::group(['prefix' => 'project'], function () {
        Route::get('/', 'ProjectController@index')->name('home.project.index'); //项目
        Route::get('/list', 'ProjectController@list')->name('home.project.list'); //列表
        Route::get('/info', 'ProjectController@info')->name('home.project.info'); //项目详情
    });
});

Route::group(['namespace' => 'User','prefix' => 'user','middleware'=> ['configs','auth','wap']], function () {
    Route::get('/', 'IndexController@index')->name('user.index.index'); //首页
    Route::any('/detail', 'IndexController@detail')->name('user.index.detail'); //编辑用户信息
    Route::any('/password', 'IndexController@password')->name('user.index.password'); //修改密码
    Route::any('/join', 'IndexController@join')->name('user.index.join'); //专栏申请
    Route::get('/praise', 'IndexController@praise')->name('user.index.praise'); //点赞记录
    Route::get('/article', 'IndexController@article')->name('user.index.article'); //发布列表
    Route::any('/publish', 'IndexController@publish')->name('user.index.publish'); //发布数据
    Route::get('/edit', 'IndexController@edit')->name('user.index.edit'); //修改数据
    Route::post('/destroy', 'IndexController@destroy')->name('user.index.destroy'); //删除数据
});